<?php
/*  
  Copyright (c) 2010-02 SongCMS 
  SongCMS All Rights Reserved. 
  Support:www.SongCMS.com
  QQ:544255858   19951025
  Author:Song  Version:3.17
  Date:2010-08-12 09:28:32
*/
session_save_path(realpath(SONGCMSROOT . 'tmp/sessions/'));
session_start(); 
$guestbook = new guestbook();
$guestbook -> Lang = $Lang;
$guestbook -> isGuestBook = $WebGuestBook;
$guestbook -> Distance = 10; 
$guestbook -> Ltext = $Html['page'];
$SC -> register -> templateObject("guestbook",$guestbook);	
if(!empty($_POST['GuestBookTitle']) && !empty($_POST['GuestBookContent'])){
	if($_SESSION['SafeCode'] != $_POST['GetCode']) MsgBox(1,$Warning[22],'1');
	$SC -> cache -> clearAll();
	$AddGuestook = $guestbook -> Add();
	if ($WebStaticHTML == 1 && $WebGuestBook == 0){ 
		$_GET['Action'] = 'GuestBook';
		$_GET['Lang'] = $Lang;
		$html = new html();
		$html -> HTMLPath = './';
		$html -> Paths(5);
		$html -> MakeAndURL();
		if(!empty($html -> Error)) die($html -> Error);
	}
	$nURL = ($WebStaticHTML==0 || $_COOKIE['isLogin'] == 'songcms') ? "./?l{$Lang}/fguestbook" : ($Lang == 1 ? "./html/guestbook/index.html" : "./html/guestbook/index{$Lang}.html");
	switch($AddGuestook){
		case 0: MsgBox(1,$Warning[18],'-1');
		case 1: MsgBox(1,$Warning[23],'-1');
		case 2: MsgBox(1,$Warning[15],'-1');
		case 9: MsgBox(1,$Warning[24],$nURL); 
	}
}
$product = new product();
$product -> Lang = $Lang;
$product -> Ltext = $Html['page'];
$SC -> register -> templateObject("product",$product);
$news = new news();
$news -> Lang = $Lang;
$news -> Ltext = $Html['page'];
$SC -> register -> templateObject("news",$news);
$article = new article();
$article -> Lang = $Lang;
$article -> Ltext = $Html['page'];
$SC -> register -> templateObject("article",$article);
$SC -> register -> templateObject("sdb",$sdb);
include_once($CodeList . 'top.php');
include_once($CodeList . 'bottom.php');
$SC -> display($TemFile,$GetUrlPar);
?>